var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var c;
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;
var d = _decorator.disallowMultiple;
var _menu = _decorator.menu;
!function (e) {
  e[e.None = 0] = "None";
  e[e.Top = 1] = "Top";
  e[e.Down = 2] = "Down";
  e[e.LEFT = 3] = "LEFT";
  e[e.RIGHT = 4] = "RIGHT";
}(c || (c = {}));
var _def_UIAdaptive = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.dir = c.None;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.onLoad = function () {
    var e = 0;
    var t = 0;
    this.dir == c.Top && (t = this._getAdaptY());
    this.dir == c.Down && (t = -this._getAdaptY());
    this.dir == c.LEFT && (e = -this._getAdaptX());
    this.dir == c.RIGHT && (e = this._getAdaptX());
    this.node.x += e;
    this.node.y += t;
  };
  _creator.prototype._getAdaptX = function () {
    var e = cc.view.getDesignResolutionSize();
    return (cc.winSize.width - e.width) / 2;
  };
  _creator.prototype._getAdaptY = function () {
    var e = cc.view.getDesignResolutionSize();
    return (cc.winSize.height - e.height) / 2;
  };
  __decorate([_property({
    type: cc.Enum(c),
    // tooltip: false
  })], _creator.prototype, "dir", undefined);
  return __decorate([_ccclass, d(), _menu("节点适配组件/adaptive")], _creator);
}(cc.Component);
exports.default = _def_UIAdaptive;